home *** CD-ROM | disk | FTP | other *** search
Makefile | 1995-12-30 | 6.5 KB | 229 lines |
- # @(#)Makefile.
- #
- # Makefile for
- #
- # PROGRAM(s) :
- # LIBRARY(s) : libwlist.a
- # AUTHOR : W. Hatch
- # Coleman Research
- # 9891 Broken Land Parkway
- # Suite 200
- # Columbia, Maryland 21045
- # Phone (301)621-8600
- # FAX (410)7210
- # uunet!bts!bill
- # DATE : Sun Jan 30 18:46:21 EST 1994
- # PROJECT : WEH Software
- #
- # This Makefile template assumes that the following shell scripts
- # are installed in one of the user's PATH directories
- #
- # sccs_admin arg1 arg2 ...
- # sccs_get arg1 arg2 ...
- # sccs_delta arg1 arg2 ...
- # sccs_edit arg1 arg2 ...
- #
- # where arg1 arg2 .... are the names of SRC, and HEADERS
- # files on which the sccs operations will be performed.
- #
- # These scripts are used to "hide" the differences between System V.3
- # and BSD 4.3 SCCS utility interfaces.
- #
- #--------------------------------------------------------------------------
-
- #--------------------------------------------------------------------------
- # 1. define symbolic constants
- #
- # directory containing general header files
- INCLUDE=-I. -I$(LOCAL)/include -I$(SYSINCLUDE)
- #
- # relocatable library to be created
- LIB=libwlist.a
- #
- # list of header files, subject to change, on which *.o depend
- HEADERS=tstring.h wlist.h
- #
- # list of source files to be compiled
- SRC= node.cc tstring.cc wlist.cc
- #
- # list of object files to be linked
- OBJ= node.o tstring.o wlist.o
- #
- #
- # compile options
- # gcc
- CC=$(CPLUS)
- AS=$(CC)
- LD=$(CC)
- STRIP=strip
- RANLIB=ranlib
- CFLAGS=-c $(INCLUDE) $(OFLAGS) # add -O after checkout
- #
- LFLAGS=
- #
- # list of all junk files that might occur in this directory
- JUNK=core a.out JOURNAL LINT paste.txt error.log dbg_jnl* CHECK CCHK CFLOW \
- MCCABE KDSI *PRINT GLINT CXREF TJ *.s tr.*
- #--------------------------------------------------------------------------
- # 2. link and load to create the executable, $(LIB) must be deleted and
- # recreated using the sorted object files
- #
- # CHOOSE ONE OF THE FOLLOWING DEPENDENCIES
- #--------------------------------------------------------------------------
- $(LIB): $(OBJ)
- rm -f $(LIB)
- ar crv $(LIB) $(OBJ)
-
- testwl: maintest.o $(LIB)
- $(CC) -o testwl maintest.o $(LIB) $(LIB)
- #--------------------------------------------------------------------------
- # 3. install all objects of this make
- #--------------------------------------------------------------------------
- install: $(LIB)
- RANLIB $(LIB)
- cp $(LIB) $(LIBDIR)
- rm -f $(LIB)
-
- #--------------------------------------------------------------------------
- # 4. initialize SCCS administration of the source files
- #--------------------------------------------------------------------------
- admin:
- sccs_admin $(SRC) $(HEADERS) $(SCRIPT) $(MANPAGES)
-
-
- #--------------------------------------------------------------------------
- # 5. lint for syntax check on all C source, headers
- # use g++ for most comprehensive syntax checking
- #--------------------------------------------------------------------------
- lint: $(SRC) $(HEADERS)
- g++ $(SRC) $(CFLAGS) 2>LINT
-
- #--------------------------------------------------------------------------
- # 6. tidy up by getting rid of all junk files
- #--------------------------------------------------------------------------
- tidy:
- rm -f $(JUNK)
-
- #--------------------------------------------------------------------------
- # 7. clean up by removing all vestiges of previous makes
- #--------------------------------------------------------------------------
- clean: tidy
- rm -f $(TEST)
- rm -f $(LIB)
- rm -f *.o
-
- #--------------------------------------------------------------------------
- # 8. uninstall all installed targets of this make
- #--------------------------------------------------------------------------
- uninstall: clean
- rm -f $(LIBDIR)/$(LIB)
- for i in $(MANPAGES); do; \
- rm -f $(MAN3)/$$i; \
- done
-
- #--------------------------------------------------------------------------
- # 9. individual dependencies for C source files as per the following
- # example:
- #
- # foobar.c: SCCS/s.foobar.c
- # sccs_get foobar.c
- #
- #--------------------------------------------------------------------------
-
- #--------------------------------------------------------------------------
- # 10. individual dependencies for relocatable object files as per
- # the following example:
- #
- # foobar.o: foobar.c $(HEADERS)
- # cc -O -c foobar.c
- #
- #--------------------------------------------------------------------------
- .SUFFIXES: .o .cc
- .cc.o:
- $(CC) $(CFLAGS) $<
-
- FFLAGS= -C++ -c -r8
-
- .SUFFIXES: .P .f
- .f.P:
- cp $*.f tmp.f
- f2c -P $(FFLAGS) tmp.f
- echo "#ifdef __cplusplus" > $*.P
- echo "extern \"C\" {" >> $*.P
- echo "#endif" >> $*.P
- cat tmp.P >> $*.P
- echo "#ifdef __cplusplus" >> $*.P
- echo "}" >> $*.P
- echo "#endif" >> $*.P
- rm -f tmp.P
-
- .SUFFIXES: .c .f
- .f.c:
- cp $*.f tmp.f
- f2c $(FFLAGS) tmp.f
- echo "#include <f2c.h>" >$*.c
- echo "#include <$*.P>" >> $*.c
- cat tmp.c >> $*.c
- rm tmp.c tmp.f
-
- #--------------------------------------------------------------------------
- # 11. individual dependencies for shell script and manual pages
- # as per the following example:
- #
- # textfile: SCCS/s.textfile
- # sccs_get textfile
- # or
- #
- # $(SRC):
- # sccs_install $(SRC)
- #
- #--------------------------------------------------------------------------
- wlist.o: wlist.cc wlist.h
-
- node.o: node.cc wlist.h
-
- tstring.o: tstring.cc tstring.h
-
- maintest.o: maintest.cc tstring.h wlist.h
-
- #--------------------------------------------------------------------------
- # 12. edit - get all of the source files ready to edit
- #--------------------------------------------------------------------------
- edit:
- sccs_edit $(SRC) $(HEADERS) $(TESTSRC)
-
- #--------------------------------------------------------------------------
- # 13. get - get all of source files in read only form
- #--------------------------------------------------------------------------
- get:
- sccs_get $(SRC) $(HEADERS) $(TESTSRC)
-
- #--------------------------------------------------------------------------
- # 14. delta - SCCS delta all source
- #--------------------------------------------------------------------------
- delta:
- sccs_delta $(SRC) $(HEADERS) $(TESTSRC)
-
- $(SRC):
- sccs_install $(SRC)
-
- #--------------------------------------------------------------------------
- # 14. print all source files
- #--------------------------------------------------------------------------
- print: $(SRC) $(HEADERS) cover
- srcpub $(HEADERS) $(SRC) Makefile >PRINT
- trmm PRINT
- offjet tr.PRINT
-
- cover:
- sed "s/LIBX/$(LIB)/" ../cover > cover
- trmm cover
- offjet tr.cover
-
- summary: $(SRC) $(HEADERS)
- srcpub $(HEADERS) |sed '/^\.TC/,/^\.ds Lt/d' >PRINT
- echo ".bp" >> PRINT
- exsum $(SRC) | sed '1,/^\.PF/d' >>PRINT
-
-
-